package headfirst.designpatterns.leaner.ducks;

import headfirst.designpatterns.leaner.ducks.fly.FlyBehavior;
import headfirst.designpatterns.leaner.ducks.fly.FlyRocketPowered;
import headfirst.designpatterns.leaner.ducks.quack.QuackBehavior;
import headfirst.designpatterns.strategy.Duck;
import headfirst.designpatterns.strategy.ModelDuck;

public class MiniDuckSimulator {

	public static void main(String[] args) {


		FlyBehavior cantFly = () -> System.out.println("I can't fly");
		QuackBehavior squeak = () -> System.out.println("Squeak");
		RubberDuck rubberDuckie = new RubberDuck(cantFly, squeak);
		DecoyDuck decoy = new DecoyDuck();



		MallardDuck mallard = new MallardDuck();
		mallard.performQuack();
		rubberDuckie.performQuack();
		decoy.performQuack();

		SuperDucks model = new ModelDuck();
		model.performFly();
		model.setFlyBehavior(new FlyRocketPowered());
		model.performFly();
	}
}
